package myky.com.doctorapp.ui

import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import com.gyf.barlibrary.ImmersionBar
import kotlinx.android.synthetic.main.activity_help_deatails.*
import kotlinx.android.synthetic.main.public_common_title.*
import myky.com.doctorapp.R
import myky.com.doctorapp.utils.Constants

class HelpDeatailsActivity : AppCompatActivity() {

    private var index: Int = 0

    private var index_parent: Int = 0

    private val ints = intArrayOf(R.array.login_related_text, R.array.message_relevant_text, R.array.health_records_text, R.array.records_relevant_text, R.array.consultation_relevant_text, R.array.remote_relevant_text, R.array.appointment_relevant_text)

    private val intArrays = intArrayOf(R.array.login_related, R.array.message_relevant, R.array.health_records, R.array.records_relevant, R.array.consultation_relevant, R.array.remote_relevant, R.array.appointment_relevant)


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_help_deatails)
        ImmersionBar.with(this).barColorInt(resources.getColor(R.color.colorPrimary)).titleBar(R.id.commonTitleLayout).navigationBarEnable(false).init()


        initView()
    }

    private fun initView() {

        val extras = intent.extras


        index=extras.getInt(Constants.HELPTITITLEINDEX)

        index_parent=extras.getInt(Constants.HELPINDEX)


        val strings_parent = resources.getStringArray(ints[index_parent])

        val strings = resources.getStringArray(intArrays[index_parent])

        activity_help_details_tv.text = strings_parent[index_parent]

        conmonTitleTextView.text = strings[index]


        backLayout.setOnClickListener { finish() }
    }
}
